package models

import (
	"gorm.io/gorm"
	"week2/types"
)

type Goods struct {
	gorm.Model
	GoodsName  string  `json:"goods_name"`
	GoodsPrice float64 `json:"goods_price"`
	GoodsNum   int     `json:"goods_num"`
	GoodsImg   string  `json:"goods_img"`
}

func (g *Goods) GoodsAdd() error {
	return types.Db.Create(&g).Error
}
